package com.gupao.proxydemo.orderdemo.db;

public class DataSourceChange {

    public final static String DEFAULT_SOURCE = null;

    public final static ThreadLocal<String> local = new ThreadLocal<String>();

    public DataSourceChange() {
    }

    public static String get() {
        return local.get();
    }

    public static void restore() {
        local.set(DEFAULT_SOURCE);
    }

    public static void set(String dataSource) {
        local.set(dataSource);
    }

    public static void set(int year) {
        local.set("DB_" + year);
    }
}
